package org.dromara.answer.domain.bo;

import lombok.*;
import org.dromara.answer.domain.AiQuestions;
import org.dromara.answer.domain.vo.AiUserAnswersVo;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.*;

import java.util.List;

/**
 * 题目业务对象 ai_questions
 *
 * @author Lion Li
 * @date 2025-04-09
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = AiQuestions.class, reverseConvertGenerate = false)
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class AiQuestionsBo extends BaseEntity {

    /**
     * 题目ID，主键
     */
    @NotNull(message = "题目ID，主键不能为空", groups = { EditGroup.class })
    private Long questionId;

    /**
     * 题目内容
     */
    @NotBlank(message = "题目内容不能为空", groups = { AddGroup.class, EditGroup.class })
    private String title;

    /**
     * 题目类型：single_choice-单选, multiple_choice-多选, fill_blank-填空, true_false-判断题
     */
    @NotBlank(message = "题目类型：single_choice-单选, multiple_choice-多选, fill_blank-填空, true_false-判断题不能为空", groups = { AddGroup.class, EditGroup.class })
    private String questionType;

    /**
     * 难度等级：1-5，默认为3
     */
    @NotNull(message = "难度等级：1-5，默认为3不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long difficulty;

    /**
     * 题目分类/标签
     */
    @NotBlank(message = "题目分类/标签不能为空", groups = { AddGroup.class, EditGroup.class })
    private String category;

    /**
     * 状态：0-禁用，1-启用
     */
    @NotNull(message = "状态：0-禁用，1-启用不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long status;

    /**
     * 题目分值
     */
    @NotNull(message = "题目分值不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long score;

    /**
     * 题目解析
     */
    @NotBlank(message = "题目解析不能为空", groups = { AddGroup.class, EditGroup.class })
    private String explanation;

    /**
     * 答案
     */
    @NotBlank(message = "答案不能为空", groups = { AddGroup.class, EditGroup.class })
    private String answer;

    /**
     * 题目选项列表
     */
    private List<AiOptionsBo> options;

    /**
     * 用户选择的选项
     */
    private AiUserAnswersBo userAnswer;

}
